package com.ruoyi.zxjd.conference.controller;

import com.ruoyi.zxjd.conference.domain.ConferenceArrange;
import com.ruoyi.zxjd.conference.domain.ConferenceProgress;
import com.ruoyi.zxjd.conference.service.IConferenceArrangeService;
import com.ruoyi.zxjd.conference.service.IConferenceProgressService;
import com.ruoyi.zxjd.work.domain.WorkArrange;
import com.ruoyi.zxjd.work.domain.WorkProgress;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 参会人员Controller（个人）
 */

@Controller
@RequestMapping("/conference/meeting")
public class MeetingController {

    private String prefix = "conference/meeting";

    @Autowired
    private IConferenceProgressService conferenceProgressService;

    @Autowired
    private IConferenceArrangeService conferenceArrangeService;

    @RequiresPermissions("conference:meeting:view")
    @GetMapping()
    public String arrange()
    {
        return prefix + "/task_to_done";
    }

    /**
     * 个人中心参会详情
     */
    //@RequiresPermissions("work:progress:detail")
    @GetMapping("/detail/{progressId}")
    public String detail(@PathVariable("progressId") Long progressId, ModelMap mmap)
    {
        ConferenceProgress conferenceProgress = conferenceProgressService.selectConferenceProgressById(progressId);
        ConferenceArrange conferenceArrange = conferenceArrangeService.selectConferenceArrangeById(conferenceProgress.getArrangeId());
        mmap.put("conferenceArrange",conferenceArrange);
        return prefix + "/detail";
    }

}
